package com.bpms.atmp.client.common;

import java.text.SimpleDateFormat;
import java.util.Comparator;
import java.util.Date;


public class GVOCompare implements Comparator<GVO> {
	
	private String column;
	
	private SimpleDateFormat dtf = new SimpleDateFormat("yyyy-MM-dd");

	
	public GVOCompare(String column){
		this.column=column;
	}

	public int compare(GVO o1, GVO o2) {
		if("recorddt".equalsIgnoreCase(column)||"impdate".equalsIgnoreCase(column)){
			String o1date=dtf.format(o1.getAttr(column));
			String o2date=dtf.format(o2.getAttr(column));
			return o1date.compareTo(o2date);
		}else{
			return o1.getAttr(column).compareTo(o2.getAttr(column));
		}
		
	}
	

}
